const app = getApp()
import { detail } from '../../../../api/mine/rule'

Page({
  data: {
    back: true,
    title: '内容',
    loading: true,
    detail: null
  },
  onLoad (options) {
    this.setData({ loading: true })
    detail(options.id).then(res => {
      const detail = res.data
      detail.content = detail.content.replace(/<img/gi, '<img style="max-width:100%;height:auto;float:left;display:block" ')

      this.setData({
        title: detail.rule_name,
        detail: detail
      })
    })
      .finally(() => {
        this.setData({ loading: false })
      })
  }
})